// 练习1：创建⼀个 Vehicle 基类，包含brand、model等属性和⼀个start⽅法。然后创建 Car 和 Motorcycl
// e 两个⼦类，它们都继承⾃ Vehicle 类，并添加各⾃特有的属性和⽅法，以及重写start⽅法。
class Vehicle {
    brand:string;
    model:string;
    constructor(brand:string,model:string){
        this.brand = brand;
        this.model = model;
    }
    start():void{
        console.log('The vehicle is starting.');
    }
}
class Car extends Vehicle{
    name:string;
    constructor(name:string){
        super('Toyota', 'Camry');
        this.name = name;
    }
    start():void{
        console.log('The car is starting.');
    }
}

class Motorcycle extends Vehicle{
    name:string;
    constructor(name:string){
        super('Honda', 'CBR');
        this.name = name;
    }
    start():void{
        console.log('The motorcycle is starting.');
    }
}

let car = new Car('My Car');
let motorcycle = new Motorcycle('My Motorcycle');
car.start();
motorcycle.start();
